#pragma once
#include "gtest/gtest.h"
#include "../MinimumDegreeSort.h"

using SG::FEMSolver::MinimumDegreeSort;
using namespace SG::DBManager;
TEST (MinimumDegreeSortTest, SortNodeId1)
{
    // Input
    std::vector<SG::DataStructure::Common::Id>  nodeIds {1, 2, 3, 4};
    std::vector<std::size_t> indexes {0, 1, 2, 3};

    // Test data
    MinimumDegreeSort::SortNodeId (nodeIds, indexes);

    // Target data
    const std::vector<SG::DataStructure::Common::Id>  nodeIds1 {1, 2, 3, 4};
    const std::vector<std::size_t> indexes1 {0, 1, 2, 3};

    // Check
    ASSERT_TRUE (nodeIds1 == nodeIds);
    ASSERT_TRUE (indexes1 == indexes);
}

TEST (MinimumDegreeSortTest, SortNodeId2)
{
    // Input
    std::vector<SG::DataStructure::Common::Id> nodeIds {4, 1, 2, 3};
    std::vector<std::size_t> indexes {0, 1, 2, 3};

    // Test data
    MinimumDegreeSort::SortNodeId (nodeIds, indexes);

    // Target data
    const std::vector<SG::DataStructure::Common::Id>  nodeIds1 {1, 2, 3, 4};
    const std::vector<std::size_t> indexes1 {1, 2, 3, 0};

    // Check
    ASSERT_TRUE (nodeIds1 == nodeIds);
    ASSERT_TRUE (indexes1 == indexes);
}